package fr.afcepf.ai85.ent;

// Generated 21 mars 2013 17:20:56 by Hibernate Tools 3.4.0.CR1

import java.util.HashSet;
import java.util.Set;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import static javax.persistence.GenerationType.IDENTITY;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.Table;

/**
 * Ecole generated by hbm2java
 */
@Entity
@Table(name = "ecole", catalog = "gepeto_db")
public class Ecole implements java.io.Serializable {

	private Integer identifiantEcole;
	private PersonnelMairie personnelMairie;
	private TypeEcole typeEcole;
	private Connexion connexion;
	private String nomEcole;
	private String adresseEcole;
	private String telEcole;
	private Set<Encadrant> encadrants = new HashSet<Encadrant>(0);
	private Set<AnneeScolaire> anneeScolaires = new HashSet<AnneeScolaire>(0);
	private Set<InscriptionEcole> inscriptionEcoles = new HashSet<InscriptionEcole>(
			0);

	public Ecole() {
	}

	public Ecole(PersonnelMairie personnelMairie, TypeEcole typeEcole,
			Connexion connexion, String nomEcole, String adresseEcole,
			String telEcole) {
		this.personnelMairie = personnelMairie;
		this.typeEcole = typeEcole;
		this.connexion = connexion;
		this.nomEcole = nomEcole;
		this.adresseEcole = adresseEcole;
		this.telEcole = telEcole;
	}

	public Ecole(PersonnelMairie personnelMairie, TypeEcole typeEcole,
			Connexion connexion, String nomEcole, String adresseEcole,
			String telEcole, Set<Encadrant> encadrants,
			Set<AnneeScolaire> anneeScolaires,
			Set<InscriptionEcole> inscriptionEcoles) {
		this.personnelMairie = personnelMairie;
		this.typeEcole = typeEcole;
		this.connexion = connexion;
		this.nomEcole = nomEcole;
		this.adresseEcole = adresseEcole;
		this.telEcole = telEcole;
		this.encadrants = encadrants;
		this.anneeScolaires = anneeScolaires;
		this.inscriptionEcoles = inscriptionEcoles;
	}

	@Id
	@GeneratedValue(strategy = IDENTITY)
	@Column(name = "IDENTIFIANT_ECOLE", unique = true, nullable = false)
	public Integer getIdentifiantEcole() {
		return this.identifiantEcole;
	}

	public void setIdentifiantEcole(Integer identifiantEcole) {
		this.identifiantEcole = identifiantEcole;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "ID_PERSONNEL_MAIRIE", nullable = false)
	public PersonnelMairie getPersonnelMairie() {
		return this.personnelMairie;
	}

	public void setPersonnelMairie(PersonnelMairie personnelMairie) {
		this.personnelMairie = personnelMairie;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "ID_TYPE_ECOLE", nullable = false)
	public TypeEcole getTypeEcole() {
		return this.typeEcole;
	}

	public void setTypeEcole(TypeEcole typeEcole) {
		this.typeEcole = typeEcole;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "ID_CONNEXION", nullable = false)
	public Connexion getConnexion() {
		return this.connexion;
	}

	public void setConnexion(Connexion connexion) {
		this.connexion = connexion;
	}

	@Column(name = "NOM_ECOLE", nullable = false, length = 50)
	public String getNomEcole() {
		return this.nomEcole;
	}

	public void setNomEcole(String nomEcole) {
		this.nomEcole = nomEcole;
	}

	@Column(name = "ADRESSE_ECOLE", nullable = false, length = 50)
	public String getAdresseEcole() {
		return this.adresseEcole;
	}

	public void setAdresseEcole(String adresseEcole) {
		this.adresseEcole = adresseEcole;
	}

	@Column(name = "TEL_ECOLE", nullable = false, length = 50)
	public String getTelEcole() {
		return this.telEcole;
	}

	public void setTelEcole(String telEcole) {
		this.telEcole = telEcole;
	}

	@OneToMany(fetch = FetchType.LAZY, mappedBy = "ecole")
	public Set<Encadrant> getEncadrants() {
		return this.encadrants;
	}

	public void setEncadrants(Set<Encadrant> encadrants) {
		this.encadrants = encadrants;
	}

	@OneToMany(fetch = FetchType.LAZY, mappedBy = "ecole")
	public Set<AnneeScolaire> getAnneeScolaires() {
		return this.anneeScolaires;
	}

	public void setAnneeScolaires(Set<AnneeScolaire> anneeScolaires) {
		this.anneeScolaires = anneeScolaires;
	}

	@OneToMany(fetch = FetchType.LAZY, mappedBy = "ecole")
	public Set<InscriptionEcole> getInscriptionEcoles() {
		return this.inscriptionEcoles;
	}

	public void setInscriptionEcoles(Set<InscriptionEcole> inscriptionEcoles) {
		this.inscriptionEcoles = inscriptionEcoles;
	}

}
